package com.min.redis.infrastructure.dataservice;

import com.min.redis.infrastructure.po.SongPO;
import com.min.redis.infrastructure.repository.SongRepository;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@AllArgsConstructor
public class SongDataService {

    private final SongRepository songRepository;

    public SongPO getSongById(Long id){
        return songRepository.getById(id);
    }

    public boolean addSong(SongPO po){
        return songRepository.save(po);
    }

    public List<SongPO> queryAllSong(){
        return songRepository.list();
    }

}
